import React from 'react';
import './Favorites.css'; // 您可以根据需要在这里添加样式
import { useNavigate } from 'react-router-dom';

const Participants = ({participants}) => {
  const navigate = useNavigate();
  return (
    <div className="favorites">
      <div className='favorites-header'>
        <h2>参与用户</h2>      
      </div>
      <div className="favorites-list">
        {participants.length > 0 ? (
          participants.map((item, index) => (
            <div key={index} className="favorite-item">
               <p onClick={()=>navigate( `/personal/${item.userId}`)}>#{item.account}</p>
            </div>
          ))
        ) : (
          <p>目前没有参与的用户</p>
        )}
      </div>
    </div>
  );
};

export default Participants;